package com.yuju.hotel.enums;
/**
 * 
 * 类名：RoomTypeReturnCodeEnum  <br />
 *
 * 功能：房间相关返回值
 *
 * @author : zhousc <br />
 * @Date : 2017年11月27日 下午3:18:23  <br />
 * @version : 1.1 <br />
 */
public enum RoomReturnCodeEnum {
	ROOM_QUERY_SUCCESS("yuju-room-1000", "房间查询成功"),
	ROOM_QUERY_FAILURE("yuju-room-1001", "房间查询失败"),
	ROOM_SAVE_SUCCESS("yuju-room-1002", "房间保存成功"),
	ROOM_SAVE_FAILURE("yuju-room-1003", "房间保存失败"),
	ROOM_UPDATE_SUCCESS("yuju-room-1004", "房间更新成功"),
	ROOM_UPDATE_FAILURE("yuju-room-1005", "房间更新失败"),
	ROOM_DEL_SUCCESS("yuju-room-1006", "房间删除成功"),
	ROOM_DEL_FAILURE("yuju-room-1007", "房间删除失败"),
	ROOM_VALID_SUCCESS("yuju-room-1008", "校检成功"),
	ROOM_VALID_FAILURE("yuju-room-1009", "校检失败");
	
	
	
	private String code;
	private String desc;
	
	RoomReturnCodeEnum(String code, String desc) {
		this.code = code;
		this.desc = desc;
	}
	
	public static String getDescByCode(String code) {
		for (RoomReturnCodeEnum enume : RoomReturnCodeEnum.values()) {
			if (enume.getCode().equals(code)) {
				return enume.getDesc();
			}
		}
		
		return "未知枚举类型";
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}
}